package com.example.jwtdemo.service.impl;

import com.example.jwtdemo.mapper.UserMapper;
import com.example.jwtdemo.pojo.Role;
import com.example.jwtdemo.pojo.User;
import com.example.jwtdemo.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Resource
    private UserMapper userMapper;

    @Override
    public User findUserByUsername(String userName) {
        User user = userMapper.findUserByUsername(userName);
        return user;
    }

    @Override
    public List<Role> findRoleByUsername(String userName) {
        List<Role> roles = userMapper.findRoleByUsername(userName);
        return roles;
    }
}
